import Http from '@/http';

export function listApi() {
    return Http.get('dictionary/list')
}

export function saveCategoryApi(params:any) {
    return params.id ? Http.put('dictionary/edit/category/' + params.id, params) : Http.post('dictionary/add/category', params)
}
export function deleteCategoryApi(id) {
    return Http.delete('dictionary/delete/category/' + id)
}


export function saveItemApi(params:any) {
    return params.id ? Http.put('dictionary/edit/item/' + params.id, params) : Http.post('dictionary/add/item', params)
}
export function deleteItemApi(id) {
    return Http.delete('dictionary/delete/item/' + id)
}


export function dictionaryItemByCategoryApi(category:string) {
    return Http.get('dictionary/getItemsByCategory/' + category)
}